home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3c / if_indextoname.z / if_indextoname
Encoding:
Text File  |  2002-10-03  |  5.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. IIIIFFFF____IIIINNNNDDDDEEEEXXXXTTTTOOOONNNNAAAAMMMMEEEE((((3333))))                                            IIIIFFFF____IIIINNNNDDDDEEEEXXXXTTTTOOOONNNNAAAAMMMMEEEE((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiiffff____iiiinnnnddddeeeexxxxttttoooonnnnaaaammmmeeee,,,, iiiiffff____nnnnaaaammmmeeeettttooooiiiinnnnddddeeeexxxx,,,, iiiiffff____nnnnaaaammmmeeeeiiiinnnnddddeeeexxxx,,,, iiiiffff____ffffrrrreeeeeeeennnnaaaammmmeeeeiiiinnnnddddeeeexxxx -
  10.      functions for converting interface index to name, and vice versa.
  11.  
  12. LLLLIIIIBBBBRRRRAAAARRRRYYYY
  13.      Standard C Library (libc, -lc)
  14.  
  15. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  16.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  17.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssoooocccckkkkeeeetttt....hhhh>>>>
  18.      ####iiiinnnncccclllluuuuddddeeee <<<<nnnneeeetttt////iiiiffff....hhhh>>>>
  19.  
  20.      cccchhhhaaaarrrr ****iiiiffff____iiiinnnnddddeeeexxxxttttoooonnnnaaaammmmeeee((((uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt iiiiffffiiiinnnnddddeeeexxxx,,,, cccchhhhaaaarrrr ****iiiiffffnnnnaaaammmmeeee))));;;;
  21.      uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt iiiiffff____nnnnaaaammmmeeeettttooooiiiinnnnddddeeeexxxx((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****iiiiffffnnnnaaaammmmeeee))));;;;
  22.      ssssttttrrrruuuucccctttt iiiiffff____nnnnaaaammmmeeeeiiiinnnnddddeeeexxxx ****((((vvvvooooiiiidddd))));;;;
  23.      vvvvooooiiiidddd iiiiffff____ffffrrrreeeeeeeennnnaaaammmmeeeeiiiinnnnddddeeeexxxx((((ssssttttrrrruuuucccctttt iiiiffff____nnnnaaaammmmeeeeiiiinnnnddddeeeexxxx ****ppppttttrrrr))));;;;
  24.  
  25. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  26.      The functions map interface index to readable interface name (such as
  27.      "lo0"), and vice versa.
  28.  
  29.      _i_f__i_n_d_e_x_t_o_n_a_m_e converts interface index to readable interface name.  The
  30.      _i_f_n_a_m_e argument must point to a buffer of at least IF_NAMESIZE bytes into
  31.      which the interface name corresponding to the specified index is
  32.      returned.  (IF_NAMESIZE is also defined in <net/if.h> and its value
  33.      includes a terminating null byte at the end of the interface name.)  This
  34.      pointer is also the return value of the function.  If there is no
  35.      interface corresponding to the specified index, NULL is returned and
  36.      errno is set to ENXIO.  If there was a system error (such as running out
  37.      of memory), errno is set to ENOMEM.
  38.  
  39.      _i_f__n_a_m_e_t_o_i_n_d_e_x converts readable interface name to interface index
  40.      positive integer value.  If the specified interface does not exist, 0
  41.      will be returned.
  42.  
  43.      _i_f__n_a_m_e_i_n_d_e_x returns an array of _i_f__n_a_m_e_i_n_d_e_x structures.  _i_f__n_a_m_e_i_n_d_e_x
  44.      is also defined in <net/if.h>, and is as follows:
  45.  
  46.           struct if_nameindex {
  47.                unsigned int   if_index;  /* 1, 2, ... */
  48.                char          *if_name;   /* null terminated name: "le0",.. */
  49.           };
  50.  
  51.  
  52.      The end of the array of structures is indicated by a structure with an
  53.      _i_f__i_n_d_e_x of 0 and an _i_f__n_a_m_e of NULL .  The function returns a NULL
  54.      pointer upon an error and errno is set to the approprate value.  The
  55.      memory used for this array of structures along with the interface names
  56.      pointed to by the _i_f__n_a_m_e members is obtained dynamically.  This memory
  57.      is freed by the _i_f__f_r_e_e_n_a_m_e_i_n_d_e_x function.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. IIIIFFFF____IIIINNNNDDDDEEEEXXXXTTTTOOOONNNNAAAAMMMMEEEE((((3333))))                                            IIIIFFFF____IIIINNNNDDDDEEEEXXXXTTTTOOOONNNNAAAAMMMMEEEE((((3333))))
  71.  
  72.  
  73.  
  74.      _i_f__f_r_e_e_n_a_m_e_i_n_d_e_x takes a pointer that was returned by _i_f__n_a_m_e_i_n_d_e_x as
  75.      argument (_p_t_r), and it reclaims the region allocated.
  76.  
  77. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  78.      _i_f__n_a_m_e_t_o_i_n_d_e_x returns 0 on error, positive integer on success.
  79.      _i_f__i_n_d_e_x_t_o_n_a_m_e and _i_f__n_a_m_e_i_n_d_e_x return NULL on errors.
  80.  
  81. SSSSTTTTAAAANNNNDDDDAAAARRRRDDDDSSSS
  82.      These functions are defined in "Basic Socket Interface Extensions for
  83.      IPv6" (RFC2533).
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.